package com.qing.switchdemo;

public class SwitchDemo01 {
    public static void main(String[] args) {
        //jdk7以后支持String字符串对比
        // char grade = 'A';
        String grade = "合格";
        switch (grade){
            case "合格":
                System.out.println("合格");
                break;//不带break，将会一直输出
            case "优良":
                System.out.println("优良");
                break;
            case "不合格":
                System.out.println("不合格");
                break;
            default://输入的不存在会出发默认值
                System.out.println("未知等级");
        }

    }

}
